package com.jt.ktdemo.adapter

import android.content.Context
import androidx.recyclerview.widget.RecyclerView

abstract class BaseRecyclerViewAdpater<T, VH: RecyclerView.ViewHolder>(var mContext: Context): RecyclerView.Adapter<VH>() {

    var dataList: MutableList<T> = mutableListOf()

    fun setData(source: MutableList<T>) {
        dataList = source
        notifyDataSetChanged()
    }

    fun addData(source: MutableList<T>) {
        dataList.addAll(source)
        notifyDataSetChanged()
    }

    override fun onBindViewHolder(holder: VH, position: Int) {

    }

    override fun getItemCount(): Int {
        return dataList.size
    }




}

